package com.mgwt.mobile.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Widget;
import com.google.web.bindery.event.shared.binder.EventBinder;
import com.google.web.bindery.event.shared.binder.EventHandler;
import com.googlecode.mgwt.mvp.client.Animation;
import com.googlecode.mgwt.ui.client.widget.LayoutPanel;
import com.mgwt.mobile.client.events.ShowMainEvent;

public class MainPanel extends LayoutPanel {

	interface MyEventBinder extends EventBinder<MainPanel> {
	}

	private static final MyEventBinder eventBinder = GWT.create(MyEventBinder.class);

	interface MainPanelUiBinder extends UiBinder<Widget, MainPanel> {
	}

	private static MainPanelUiBinder uiBinder = GWT.create(MainPanelUiBinder.class);

	public MainPanel() {
		eventBinder.bindEventHandlers(this, Eventor.getInstance());

		add(uiBinder.createAndBindUi(this));
	}

	@EventHandler
	void onShowLogin(ShowMainEvent event) {
		Animator.getInstance().goTo(this, Animation.FLIP);
	}

}
